<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To fetch the Hyper V Status # Configuration Type - COMPUTER #> # Check the status of Hyper-V $featureStatus = Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online # Extract the state of the feature $state = $featureStatus.State # Output the status if ($state -eq 'Enabled') { Write-Host "Hyper-V is enabled." } elseif ($state -eq 'Disabled') { Write-Host "Hyper-V is disabled." } else { Write-Host "Hyper-V status is unknown." }